<?php
/* @var $this LocationController */
/* @var $model Location */
/* @var $gMap gMap */
?>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="texteSimple">
        <tr>
        </tr>
        <tr>
          <td align="center"><hr noshade width="100%" color="#CCCCCC" size="1" ></td>
        </tr>
        <tr>
          <td><a href=" <?php if(isset($_SERVER['HTTP_REFERER']))echo $_SERVER['HTTP_REFERER'];?>" class="texteSimple">
          <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/icon-backpage.png" width="22" height="19" border="0" align="bottom">&nbsp;&nbsp;&nbsp;<?php echo Yii::t('main','my-selection-return');?></a></td>
        </tr>
        <tr>
          <td>
          <div id="ficheMini">
            <table width="100%" border="0" cellpadding="0" cellspacing="5" id="tableFicheMini">
              <tr>
                <td colspan="2" class="ficheTitreLieu"><span class="ficheDepartementLieu"><a href="#"></a></span><?php echo CHtml::encode($model->name);?> <span class="ficheDepartementLieu"><?php echo CHtml::encode($model->idDepartment->name);?></span></td>
                <td width="212" class="ficheZipCodeLieu"><?php echo CHtml::encode($model->town." ".$model->zip_code);?></td>
              </tr>
              <tr>
                <td colspan="2">
                <?php 	$this->renderPartial('_viewSlider',array('model'=>$model,)); ?>
               <br>
                </td>
                <td rowspan="2" valign="top"><p class="ficheTypeLieu"><?php echo $model->getAttributeLabel('id_type') ?> : <span class="ficheDetails"><?php echo CHtml::encode($model->idType->name);?></span></p>
                  <p class="ficheTypeLieu"><?php echo $model->getAttributeLabel('capacity') ?> : <span class="ficheDetails"><?php echo CHtml::encode($model->capacity);?></span> <?php echo Yii::t('main', 'persons');?></p>
                <p class="ficheTypeLieu"><?php echo $model->getAttributeLabel('events') ?> : <br>
                <?php foreach (Event::model()->findAll() as $event) {
                		$present=false;
                		if(!empty($model->locationEvents))
                		foreach ($model->locationEvents as $locevent){
		                	if($locevent->id_event==$event->id){
		                		$present=true;
		                		break;
		                	}
                		}
                		if($present){               	?>
                		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo Yii::app()->request->baseUrl; ?>/images/bt-check_ok.png" width="15" height="13"><span class="ficheDetails"><?php echo CHtml::encode($event->name);?></span><br>
                		<?php
                		}
                		else{?>
                		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="<?php echo Yii::app()->request->baseUrl; ?>/images/bt-check_empty.png" width="15" height="13"><span class="ficheDetails"><?php echo CHtml::encode($event->name);?></span><br>
                		<?php }
                		
                }?>
				
				<p class="ficheTypeLieu"><?php echo $model->getAttributeLabel('langs') ?> : 
					<span class="ficheDetails">
					<?php 
						$i=0;
						if(!empty($model->locationLangs))
                		foreach ($model->locationLangs as $loclang){                			
                			echo $i==0?"":", "; echo CHtml::encode($loclang->idLang->code);	$i++;
                		}					
					?>
					</span>
				</p>
                <p class="ficheTypeLieu"><?php echo $model->getAttributeLabel('services') ?> : <br><span class="ficheDetails">                
                <?php    
                if(!empty($model->locationServices))
                foreach ($model->locationServices as $service){?>
                	   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo CHtml::encode($service->idService->name);?><br> 
                	
                <?php } ?>
                </p>
                <p class="ficheTypeLieu" style="text-align:center">
                <?php if(!empty($model->site)){
                	echo '<a href="'.CHtml::encode($model->site).'" target="_blank"><img src="'.Yii::app()->request->baseUrl.'/images/bt-site-et-adres.png" alt="" width="173" height="23" border="0"></a>';
                } ?>               	
                	
                	</p>
                <p class="ficheTypeLieu" style="text-align:center"><a href="<?php echo Yii::app()->urlManager->createUrl('site/addCart',array('id'=>$model->id));?>" class="ficheTypeLieu"><img src="<?php echo Yii::app()->request->baseUrl; ?>/images/bt-ajoutlieu.png" width="173" height="23" border="0" align="absmiddle"></a></p>
                <p align="center">
                <?php if(!empty($model->facebook)){
                	echo '<a href="'.CHtml::encode($model->facebook).'"><img src="'.Yii::app()->request->baseUrl.'/images/icon-facedebouc.png" alt="" width="20" height="22" border="0" align="absmiddle"></a>';
                } 
                ?>    
                </p>
                <p>&nbsp;</p>
                <p>&nbsp;</p>
                <div class="ficheTypeLieu" style="width:100%;text-align:center;">
                	<?php $gMap->renderMap(); ?>  
                </div></td>
              </tr>
              <tr>
                <td width="409"><p><?php echo $model->description;?></p></td>
                <td width="363" align="left" valign="top"><hr noshade width="100%" color="#CCCCCC" size="1" ><p class="ficheServicesTitres">Les Services</p>
                <p><?php echo $model->service;?></p>               
				<hr noshade width="100%" color="#CCCCCC" size="1" >
                <p class="ficheServicesTitres">Documentation  
                <?php 
                	foreach ($model->pdfs as $pdf){                		
                		echo '<a target="_blank" href="'.$pdf->getFullPath().'">';
                		echo '<img src="'.Yii::app()->request->baseUrl.'/images/icone_pdf.gif" width="16" height="16" border="0" align="absmiddle"></a>';                	}
                ?>                
                </p>
                </td>
              </tr>
          </table>
          </div>
          </td>
        </tr>
      </table>
</div>